package com.tbit.uqbike.object.pojo.statistics;

import lombok.Data;

import java.util.Date;

/**
 * @Author HZW
 * @ClassName BrandDataDatSta
 * @Description
 * @date 2022/3/31 10:26
 * @Version 1.0
 */
@Data
public class BrandDataDaySta {
    /**
     * 品牌id
     */
    private Integer brandId;
    /**
     * 订单日期
     */
    private String orderDate;
    /**
     * 添加时间
     */
    private Date addTime;
    /**
     * 0为金额，1为订单
     */
    private Integer type;
    /**
     * 骑行订单支付
     */
    private int orderPayMoney;
    /**
     * 骑行订单未支付
     */
    private int orderNoPayMoney;
    /**
     * 骑行收入
     */
    private int RideIncome;
    /**
     * 罚款收入
     */
    private int fineIncome;
    /**
     * 骑行订单退款
     */
    private int rideOrderRefund;
    /**
     * 骑行卡
     */
    private int rideCard;
    /**
     * 骑行卡订单退款
     */
    private int rideCardRefund;
    /**
     * 免押卡
     */
    private int depositCard;
    /**
     * 免押卡订单退款
     */
    private int depositCardRefund;
    /**
     * 会员卡
     */
    private int vipCard;
    /**
     * 会员卡订单退款
     */
    private int vipCardRefund;
    /**
     * 优惠券
     */
    private int couponOrder;
    /**
     * 优惠券订单退款
     */
    private int couponOrderRefund;
    /**
     * 用户提交押金
     */
    private int userCommitPledge;
    /**
     * 用户退还押金
     */
    private int userRefundPledge;
    /**
     * 手动充值余额
     */
    private int manualRechargeMoney;
    /**
     * 手动扣款余额
     */
    private int manualDeductMoney;
    /**
     * 用户充值金额
     */
    private int rechargeMoney;
    /**
     * 充值订单退款
     */
    private int rechargeRefund;
    /**
     * 日期
     */
    private String date;
    /**
     * 总数
     */
    private int total;
    /**
     * 用户余额差值总数
     */
    private int userBalanceMargin;
    /**
     * 用户押金差值总数
     */
    private int userPledgeMargin;
    /**
     * 品牌名称
     */
    private String BrandName;

    public BrandDataDaySta() {
    }

    public BrandDataDaySta(Integer brandId, String orderDate, Integer type) {
        this.brandId = brandId;
        this.orderDate = orderDate;
        this.type = type;
    }

    public void setTotal(BrandDataDaySta brandDataDaySta) {
        Integer total = brandDataDaySta.getOrderPayMoney() + brandDataDaySta.getRideCard() +
                brandDataDaySta.getVipCard() + brandDataDaySta.getDepositCard() +
                brandDataDaySta.getCouponOrder()
                - brandDataDaySta.getRideOrderRefund() - brandDataDaySta.getRideCardRefund() -
                brandDataDaySta.getVipCardRefund() - brandDataDaySta.getDepositCardRefund()
                - brandDataDaySta.getCouponOrderRefund();
        this.total = total;
    }

    public void setUserPledgeMargin(BrandDataDaySta brandDataDaySta) {
        Integer total = brandDataDaySta.getUserCommitPledge() - brandDataDaySta.getUserRefundPledge();
        this.userPledgeMargin = total;
    }

    public void setUserBalanceMargin(BrandDataDaySta brandDataDaySta) {
        Integer total = brandDataDaySta.getRechargeMoney() +
                brandDataDaySta.getManualRechargeMoney() +
                brandDataDaySta.getRideOrderRefund() -
                brandDataDaySta.getRechargeRefund() -
                brandDataDaySta.getManualDeductMoney() -
                brandDataDaySta.getOrderPayMoney();
        this.userBalanceMargin = total;
    }
}
